﻿sampler uImage0 : register(s0);
float3 uColor;
float3 uSecondaryColor;
float2 uScreenResolution;
float2 uScreenPosition;
float2 uTargetPosition;
float2 uDirection;
float uOpacity;
float uTime;
float uIntensity;
float uProgress;
float2 uImageOffset;
float uSaturation;
float4 uSourceRect;
float2 uZoom;
float HeatStroke1(float low, float high)
{
    return uProgress * (high - low) + low;
}
float4 HeatStroke2(float2 coords : TEXCOORD0) : COLOR0
{
    float2 zoomedCoords = (coords - float2(0.5, 0.5)) * HeatStroke1(1.0 - 0.03 * (uColor.r + uColor.g), 1.0) + float2(0.5, 0.5);
    float4 zoomedTex = tex2D(uImage0, zoomedCoords);
    float4 screenTex = tex2D(uImage0, coords);
    float alpha = 0.3 * uColor.b * (uColor.r + uColor.g);
    float3 blendedColor = alpha * zoomedTex.rgb + (1 - alpha) * screenTex.rgb;
    return float4(blendedColor, 1.0);
}
technique Technique1
{
    pass HeatStroke2
    {
        PixelShader = compile ps_2_0 HeatStroke2();
    }
}